/**
 *Copyright (c) 2024 watereyes
 * workflow is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.workflow.baseConfig.service;

import com.koron.workflow.baseConfig.bean.DepartmentBean;
import com.koron.workflow.common.bean.PageBean;
import com.koron.workflow.common.bean.StaffBean;
import org.koron.ebs.mybatis.SessionFactory;
import org.swan.bean.MessageBean;

import java.util.List;

/**
 * @author qingfeng
 * @description: TODO
 * @date 2020/4/13 11:02
 */
public interface DepartmentService {

    List<DepartmentBean> queryTree(SessionFactory factory);

    List<DepartmentBean> queryForAll(SessionFactory factory);

    PageBean<DepartmentBean> queryForList(SessionFactory factory,String parentId, Integer page, Integer pageSize);

    /**
     * 保存
     * @param factory
     * @param bean
     */
    MessageBean<String> save(SessionFactory factory, DepartmentBean bean, StaffBean user);

    /**
     * 删除
     * @param factory
     * @param id
     */
    void delete(SessionFactory factory,String id);

    /**
     * 查询详情
     * @param factory
     * @param id
     * @return
     */
    DepartmentBean queryForObject(SessionFactory factory,String id);
}
